﻿using System;
using SuperSocket.SocketBase.Command;
using SuperSocketServer.AppBase;
using SuperSocketServer.Commands.BaseService;

namespace SuperSocketServer.Commands.PreAppleFile
{
  public   class DecRemedy : CommandBase<MySession, MyRequestInfo>, IPush
  {
      private const int Action = (int)SuperSocketServer.Commands.BaseService.PreAppleFile.DecRemedy;
      public override string Name => ((int)Action).ToString();

      /// <inheritdoc />
      /// <summary>
      /// 上行（来自客户端的信息）
      /// </summary>
      /// <param name="session"></param>
      /// <param name="requestInfo"></param>
      public override void ExecuteCommand(MySession session, MyRequestInfo requestInfo)
      {
          Console.WriteLine($"{((SuperSocketServer.Commands.BaseService.PreAppleFile)Action).GetDescription()}命令被执行");
          Console.WriteLine("内容是" + requestInfo.Body);
          this.Push(session, (ushort)Action, $"收到{((SuperSocketServer.Commands.BaseService.PreAppleFile)Action).GetDescription()}信息");
      }
  }
}
